package org.gdstash.util;

import java.awt.*;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;

public class GDColor {
    public static final String HTML_COLOR_GD_A_AQUA_LIGHTUI = "<font color = \"#60BC9C\">";
    private static final Color COLOR_FG_COMMON_LIGHTUI;
    private static final Color COLOR_FG_MAGICAL_LIGHTUI;
    private static final Color COLOR_FG_RARE_LIGHTUI;
    private static final Color COLOR_FG_EPIC_LIGHTUI;
    private static final Color COLOR_FG_LEGENDARY_LIGHTUI;
    private static final Color COLOR_FG_COMPONENT_LIGHTUI;
    private static final Color COLOR_FG_ENCHANTMENT_LIGHTUI;
    private static final Color COLOR_FG_ARTIFACT_LIGHTUI;
    private static final Color COLOR_FG_COMMON_DARKUI;
    private static final Color COLOR_FG_MAGICAL_DARKUI;
    private static final Color COLOR_FG_RARE_DARKUI;
    private static final Color COLOR_FG_EPIC_DARKUI;
    private static final Color COLOR_FG_LEGENDARY_DARKUI;
    private static final Color COLOR_FG_COMPONENT_DARKUI;
    private static final Color COLOR_FG_ENCHANTMENT_DARKUI;
    private static final Color COLOR_FG_ARTIFACT_DARKUI;
    private static final Color COLOR_BG_COMMON_LIGHTUI;
    private static final Color COLOR_BG_MAGICAL_LIGHTUI;
    private static final Color COLOR_BG_RARE_LIGHTUI;
    private static final Color COLOR_BG_EPIC_LIGHTUI;
    private static final Color COLOR_BG_LEGENDARY_LIGHTUI;
    private static final Color COLOR_BG_COMMON_DARKUI;
    private static final Color COLOR_BG_MAGICAL_DARKUI;
    private static final Color COLOR_BG_RARE_DARKUI;
    private static final Color COLOR_BG_EPIC_DARKUI;
    private static final Color COLOR_BG_LEGENDARY_DARKUI;
    private static final Color COLOR_OVERLAY_COMMON;
    private static final Color COLOR_OVERLAY_MAGICAL;
    private static final Color COLOR_OVERLAY_RARE;
    private static final Color COLOR_OVERLAY_EPIC;
    private static final Color COLOR_OVERLAY_LEGENDARY;
    private static final Color COLOR_OVERLAY_ARTIFACT;
    private static final Color COLOR_OVERLAY_COMPONENT;
    private static final Color COLOR_OVERLAY_ENCHANTMENT;
    private static final Color COLOR_OVERLAY_QUEST;
    private static final Color COLOR_OVERLAY_LORE;
    private static final String HTML_COLOR_MAGIC_LIGHTUI = "<font color = \"#B48200\">";
    private static final String HTML_COLOR_RARE_LIGHTUI = "<font color = \"#00460A\">";
    private static final String HTML_COLOR_EPIC_LIGHTUI = "<font color = \"#002864\">";
    private static final String HTML_COLOR_LEGENDARY_LIGHTUI = "<font color = \"#320064\">";
    private static final String HTML_COLOR_QUEST_LIGHTUI = "<font color = \"#320064\">";
    private static final String HTML_COLOR_COMPONENT_LIGHTUI = "<font color = \"#DA9345\">";
    private static final String HTML_COLOR_ENCHANTMENT_LIGHTUI = "<font color = \"#88BE00\">";
    private static final String HTML_COLOR_SKILL_LIGHTUI = "<font color = \"#598AE5\">";
    private static final String HTML_COLOR_ITEM_TYPE_LIGHTUI = "<font color = \"#C0A560\">";
    private static final String HTML_COLOR_ITEMSET_LIGHTUI = "<font color = \"#4D8489\">";
    private static final String HTML_COLOR_STAT_LIGHTUI = "<font color = \"#404040\">";
    private static final String HTML_COLOR_USED_SLOTS_LIGHTUI = "<font color = \"#000000\">";
    private static final String HTML_COLOR_CHAR_GD_LIGHTUI = "<font color = \"#990000\">";
    private static final String HTML_COLOR_CHAR_AOM_LIGHTUI = "<font color = \"#008800\">";
    private static final String HTML_COLOR_CHAR_FG_LIGHTUI = "<font color = \"#BB4000\">";
    private static final String HTML_COLOR_MAGIC_DARKUI = "<font color = \"#FFF62C\">";
    private static final String HTML_COLOR_RARE_DARKUI = "<font color = \"#10EB5D\">";
    private static final String HTML_COLOR_EPIC_DARKUI = "<font color = \"#39ABCD\">";
    private static final String HTML_COLOR_LEGENDARY_DARKUI = "<font color = \"#BD9AC7\">";
    private static final String HTML_COLOR_QUEST_DARKUI = "<font color = \"#BD9AC7\">";
    private static final String HTML_COLOR_COMPONENT_DARKUI = "<font color = \"#DA9345\">";
    private static final String HTML_COLOR_ENCHANTMENT_DARKUI = "<font color = \"#78AA00\">";
    private static final String HTML_COLOR_SKILL_DARKUI = "<font color = \"#598AE5\">";
    private static final String HTML_COLOR_ITEM_TYPE_DARKUI = "<font color = \"#C0A560\">";
    private static final String HTML_COLOR_ITEMSET_DARKUI = "<font color = \"#4D8489\">";
    private static final String HTML_COLOR_STAT_DARKUI = "<font color = \"#C0C0C0\">";
    private static final String HTML_COLOR_USED_SLOTS_DARKUI = "<font color = \"#FFFFFF\">";
    private static final String HTML_COLOR_CHAR_GD_DARKUI = "<font color = \"#990000\">";
    private static final String HTML_COLOR_CHAR_AOM_DARKUI = "<font color = \"#008800\">";
    private static final String HTML_COLOR_CHAR_FG_DARKUI = "<font color = \"#BB4000\">";
    public static final String HTML_COLOR_GD_B_BLUE_LIGHTUI = "<font color = \"#3298B5\">";
    public static final String HTML_COLOR_GD_C_CYAN_LIGHTUI = "<font color = \"#00C6C6\">";
    public static final String HTML_COLOR_GD_D_DARKGRAY_LIGHTUI = "<font color = \"#404040\">";
    public static final String HTML_COLOR_GD_F_FUSHIA_LIGHTUI = "<font color = \"#F76782\">";
    public static final String HTML_COLOR_GD_G_GREEN_LIGHTUI = "<font color = \"#0DBC47\">";
    public static final String HTML_COLOR_GD_I_INDIGO_LIGHTUI = "<font color = \"#5A039A\">";
    public static final String HTML_COLOR_GD_K_KHAKI_LIGHTUI = "<font color = \"#A8A163\">";
    public static final String HTML_COLOR_GD_L_OLIVE_LIGHTUI = "<font color = \"#7CAD00\">";
    public static final String HTML_COLOR_GD_M_MAROON_LIGHTUI = "<font color = \"#800000\">";
    public static final String HTML_COLOR_GD_O_ORANGE_LIGHTUI = "<font color = \"#D38E43\">";
    public static final String HTML_COLOR_GD_P_PURPLE_LIGHTUI = "<font color = \"#A767C6\">";
    public static final String HTML_COLOR_GD_R_RED_LIGHTUI = "<font color = \"#FF2E05\">";
    public static final String HTML_COLOR_GD_S_SILVER_LIGHTUI = "<font color = \"#787878\">";
    public static final String HTML_COLOR_GD_T_TEAL_LIGHTUI = "<font color = \"#00C6A2\">";
    public static final String HTML_COLOR_GD_W_WHITE_LIGHTUI = "<font color = \"#9A9A9A\">";
    public static final String HTML_COLOR_GD_Y_YELLOW_LIGHTUI = "<font color = \"#B78021\">";
    public static final String HTML_COLOR_END = "</font>";
    private static final String HTML_COLOR_GD_A_AQUA_DARKUI = "<font color = \"#80FFD5\">";
    private static final String HTML_COLOR_GD_B_BLUE_DARKUI = "<font color = \"#39ABCD\">";
    private static final String HTML_COLOR_GD_C_CYAN_DARKUI = "<font color = \"#00FFFF\">";
    private static final String HTML_COLOR_GD_D_DARKGRAY_DARKUI = "<font color = \"#1A1A1A\">";
    private static final String HTML_COLOR_GD_F_FUSHIA_DARKUI = "<font color = \"#FF6984\">";
    private static final String HTML_COLOR_GD_G_GREEN_DARKUI = "<font color = \"#10EB5D\">";
    private static final String HTML_COLOR_GD_I_INDIGO_DARKUI = "<font color = \"#5A039A\">";
    private static final String HTML_COLOR_GD_K_KHAKI_DARKUI = "<font color = \"#F1E78D\">";
    private static final String HTML_COLOR_GD_L_OLIVE_DARKUI = "<font color = \"#92CC00\">";
    private static final String HTML_COLOR_GD_M_MAROON_DARKUI = "<font color = \"#800000\">";
    private static final String HTML_COLOR_GD_O_ORANGE_DARKUI = "<font color = \"#F3A44D\">";
    private static final String HTML_COLOR_GD_P_PURPLE_DARKUI = "<font color = \"#BD9AC7\">";
    private static final String HTML_COLOR_GD_R_RED_DARKUI = "<font color = \"#FF4200\">";
    private static final String HTML_COLOR_GD_S_SILVER_DARKUI = "<font color = \"#9A9A9A\">";
    private static final String HTML_COLOR_GD_T_TEAL_DARKUI = "<font color = \"#00FFD2\">";
    private static final String HTML_COLOR_GD_W_WHITE_DARKUI = "<font color = \"#FFFFFF\">";
    private static final String HTML_COLOR_GD_Y_YELLOW_DARKUI = "<font color = \"#FFF62C\">";
    public static Color COLOR_FG_COMMON;
    public static Color COLOR_FG_MAGICAL;
    public static Color COLOR_FG_RARE;
    public static Color COLOR_FG_EPIC;
    public static Color COLOR_FG_LEGENDARY;
    public static Color COLOR_FG_COMPONENT;
    public static Color COLOR_FG_ENCHANTMENT;
    public static Color COLOR_FG_ARTIFACT;
    public static Color COLOR_BG_COMMON;
    public static Color COLOR_BG_MAGICAL;
    public static Color COLOR_BG_RARE;
    public static Color COLOR_BG_EPIC;
    public static Color COLOR_BG_LEGENDARY;
    public static String HTML_COLOR_MAGIC;
    public static String HTML_COLOR_RARE;
    public static String HTML_COLOR_EPIC;
    public static String HTML_COLOR_LEGENDARY;
    public static String HTML_COLOR_QUEST;
    public static String HTML_COLOR_COMPONENT;
    public static String HTML_COLOR_ENCHANTMENT;
    public static String HTML_COLOR_SKILL;
    public static String HTML_COLOR_ITEM_TYPE;
    public static String HTML_COLOR_ITEMSET;
    public static String HTML_COLOR_STAT;
    public static String HTML_COLOR_USED_SLOTS;
    public static String HTML_COLOR_CHAR_GD;
    public static String HTML_COLOR_CHAR_AOM;
    public static String HTML_COLOR_CHAR_FG;
    public static String HTML_COLOR_GD_A_AQUA;
    public static String HTML_COLOR_GD_B_BLUE;
    public static String HTML_COLOR_GD_C_CYAN;
    public static String HTML_COLOR_GD_D_DARKGRAY;
    public static String HTML_COLOR_GD_F_FUSHIA;
    public static String HTML_COLOR_GD_G_GREEN;
    public static String HTML_COLOR_GD_I_INDIGO;
    public static String HTML_COLOR_GD_K_KHAKI;
    public static String HTML_COLOR_GD_L_OLIVE;
    public static String HTML_COLOR_GD_M_MAROON;
    public static String HTML_COLOR_GD_O_ORANGE;
    public static String HTML_COLOR_GD_P_PURPLE;
    public static String HTML_COLOR_GD_R_RED;
    public static String HTML_COLOR_GD_S_SILVER;
    public static String HTML_COLOR_GD_T_TEAL;
    public static String HTML_COLOR_GD_W_WHITE;
    public static String HTML_COLOR_GD_Y_YELLOW;
    private static UIType uiType;

    public static void setLookAndFeelUI(final String className) {
        final UIType uiType = getLookAndFeelUIType(className);
        setUI(uiType);
    }

    public static UIType getLookAndFeelUIType(final String className) {
        if (className == null) {
            return UIType.Light;
        }
        if (className.equals("com.jtattoo.plaf.hifi.HiFiLookAndFeel")) {
            return UIType.Dark;
        }
        if (className.equals("com.jtattoo.plaf.noire.NoireLookAndFeel")) {
            return UIType.Dark;
        }
        return UIType.Light;
    }

    public static void setUI(final UIType uiType) {
        GDColor.uiType = uiType;
        if (uiType == UIType.Dark) {
            GDColor.COLOR_FG_COMMON = GDColor.COLOR_FG_COMMON_DARKUI;
            GDColor.COLOR_FG_MAGICAL = GDColor.COLOR_FG_MAGICAL_DARKUI;
            GDColor.COLOR_FG_RARE = GDColor.COLOR_FG_RARE_DARKUI;
            GDColor.COLOR_FG_EPIC = GDColor.COLOR_FG_EPIC_DARKUI;
            GDColor.COLOR_FG_LEGENDARY = GDColor.COLOR_FG_LEGENDARY_DARKUI;
            GDColor.COLOR_FG_COMPONENT = GDColor.COLOR_FG_COMPONENT_DARKUI;
            GDColor.COLOR_FG_ENCHANTMENT = GDColor.COLOR_FG_ENCHANTMENT_DARKUI;
            GDColor.COLOR_FG_ARTIFACT = GDColor.COLOR_FG_ARTIFACT_DARKUI;
            GDColor.COLOR_BG_COMMON = GDColor.COLOR_BG_COMMON_DARKUI;
            GDColor.COLOR_BG_MAGICAL = GDColor.COLOR_BG_MAGICAL_DARKUI;
            GDColor.COLOR_BG_RARE = GDColor.COLOR_BG_RARE_DARKUI;
            GDColor.COLOR_BG_EPIC = GDColor.COLOR_BG_EPIC_DARKUI;
            GDColor.COLOR_BG_LEGENDARY = GDColor.COLOR_BG_LEGENDARY_DARKUI;
            GDColor.HTML_COLOR_MAGIC = "<font color = \"#FFF62C\">";
            GDColor.HTML_COLOR_RARE = "<font color = \"#10EB5D\">";
            GDColor.HTML_COLOR_EPIC = "<font color = \"#39ABCD\">";
            GDColor.HTML_COLOR_LEGENDARY = "<font color = \"#BD9AC7\">";
            GDColor.HTML_COLOR_QUEST = "<font color = \"#BD9AC7\">";
            GDColor.HTML_COLOR_COMPONENT = "<font color = \"#DA9345\">";
            GDColor.HTML_COLOR_ENCHANTMENT = "<font color = \"#78AA00\">";
            GDColor.HTML_COLOR_SKILL = "<font color = \"#598AE5\">";
            GDColor.HTML_COLOR_ITEM_TYPE = "<font color = \"#C0A560\">";
            GDColor.HTML_COLOR_ITEMSET = "<font color = \"#4D8489\">";
            GDColor.HTML_COLOR_STAT = "<font color = \"#C0C0C0\">";
            GDColor.HTML_COLOR_USED_SLOTS = "<font color = \"#FFFFFF\">";
            GDColor.HTML_COLOR_CHAR_GD = "<font color = \"#990000\">";
            GDColor.HTML_COLOR_CHAR_AOM = "<font color = \"#008800\">";
            GDColor.HTML_COLOR_CHAR_FG = "<font color = \"#BB4000\">";
            GDColor.HTML_COLOR_GD_A_AQUA = "<font color = \"#80FFD5\">";
            GDColor.HTML_COLOR_GD_B_BLUE = "<font color = \"#39ABCD\">";
            GDColor.HTML_COLOR_GD_C_CYAN = "<font color = \"#00FFFF\">";
            GDColor.HTML_COLOR_GD_D_DARKGRAY = "<font color = \"#1A1A1A\">";
            GDColor.HTML_COLOR_GD_F_FUSHIA = "<font color = \"#FF6984\">";
            GDColor.HTML_COLOR_GD_G_GREEN = "<font color = \"#10EB5D\">";
            GDColor.HTML_COLOR_GD_I_INDIGO = "<font color = \"#5A039A\">";
            GDColor.HTML_COLOR_GD_K_KHAKI = "<font color = \"#F1E78D\">";
            GDColor.HTML_COLOR_GD_L_OLIVE = "<font color = \"#92CC00\">";
            GDColor.HTML_COLOR_GD_M_MAROON = "<font color = \"#800000\">";
            GDColor.HTML_COLOR_GD_O_ORANGE = "<font color = \"#F3A44D\">";
            GDColor.HTML_COLOR_GD_P_PURPLE = "<font color = \"#BD9AC7\">";
            GDColor.HTML_COLOR_GD_R_RED = "<font color = \"#FF4200\">";
            GDColor.HTML_COLOR_GD_S_SILVER = "<font color = \"#9A9A9A\">";
            GDColor.HTML_COLOR_GD_T_TEAL = "<font color = \"#00FFD2\">";
            GDColor.HTML_COLOR_GD_W_WHITE = "<font color = \"#FFFFFF\">";
            GDColor.HTML_COLOR_GD_Y_YELLOW = "<font color = \"#FFF62C\">";
        }
        if (uiType == UIType.Light) {
            GDColor.COLOR_FG_COMMON = GDColor.COLOR_FG_COMMON_LIGHTUI;
            GDColor.COLOR_FG_MAGICAL = GDColor.COLOR_FG_MAGICAL_LIGHTUI;
            GDColor.COLOR_FG_RARE = GDColor.COLOR_FG_RARE_LIGHTUI;
            GDColor.COLOR_FG_EPIC = GDColor.COLOR_FG_EPIC_LIGHTUI;
            GDColor.COLOR_FG_LEGENDARY = GDColor.COLOR_FG_LEGENDARY_LIGHTUI;
            GDColor.COLOR_FG_COMPONENT = GDColor.COLOR_FG_COMPONENT_LIGHTUI;
            GDColor.COLOR_FG_ENCHANTMENT = GDColor.COLOR_FG_ENCHANTMENT_LIGHTUI;
            GDColor.COLOR_FG_ARTIFACT = GDColor.COLOR_FG_ARTIFACT_LIGHTUI;
            GDColor.COLOR_BG_COMMON = GDColor.COLOR_BG_COMMON_LIGHTUI;
            GDColor.COLOR_BG_MAGICAL = GDColor.COLOR_BG_MAGICAL_LIGHTUI;
            GDColor.COLOR_BG_RARE = GDColor.COLOR_BG_RARE_LIGHTUI;
            GDColor.COLOR_BG_EPIC = GDColor.COLOR_BG_EPIC_LIGHTUI;
            GDColor.COLOR_BG_LEGENDARY = GDColor.COLOR_BG_LEGENDARY_LIGHTUI;
            GDColor.HTML_COLOR_MAGIC = "<font color = \"#B48200\">";
            GDColor.HTML_COLOR_RARE = "<font color = \"#00460A\">";
            GDColor.HTML_COLOR_EPIC = "<font color = \"#002864\">";
            GDColor.HTML_COLOR_LEGENDARY = "<font color = \"#320064\">";
            GDColor.HTML_COLOR_QUEST = "<font color = \"#320064\">";
            GDColor.HTML_COLOR_COMPONENT = "<font color = \"#DA9345\">";
            GDColor.HTML_COLOR_ENCHANTMENT = "<font color = \"#88BE00\">";
            GDColor.HTML_COLOR_SKILL = "<font color = \"#598AE5\">";
            GDColor.HTML_COLOR_ITEM_TYPE = "<font color = \"#C0A560\">";
            GDColor.HTML_COLOR_ITEMSET = "<font color = \"#4D8489\">";
            GDColor.HTML_COLOR_STAT = "<font color = \"#404040\">";
            GDColor.HTML_COLOR_USED_SLOTS = "<font color = \"#000000\">";
            GDColor.HTML_COLOR_CHAR_GD = "<font color = \"#990000\">";
            GDColor.HTML_COLOR_CHAR_AOM = "<font color = \"#008800\">";
            GDColor.HTML_COLOR_CHAR_FG = "<font color = \"#BB4000\">";
            GDColor.HTML_COLOR_GD_A_AQUA = "<font color = \"#60BC9C\">";
            GDColor.HTML_COLOR_GD_B_BLUE = "<font color = \"#3298B5\">";
            GDColor.HTML_COLOR_GD_C_CYAN = "<font color = \"#00C6C6\">";
            GDColor.HTML_COLOR_GD_D_DARKGRAY = "<font color = \"#404040\">";
            GDColor.HTML_COLOR_GD_F_FUSHIA = "<font color = \"#F76782\">";
            GDColor.HTML_COLOR_GD_G_GREEN = "<font color = \"#0DBC47\">";
            GDColor.HTML_COLOR_GD_I_INDIGO = "<font color = \"#5A039A\">";
            GDColor.HTML_COLOR_GD_K_KHAKI = "<font color = \"#A8A163\">";
            GDColor.HTML_COLOR_GD_L_OLIVE = "<font color = \"#7CAD00\">";
            GDColor.HTML_COLOR_GD_M_MAROON = "<font color = \"#800000\">";
            GDColor.HTML_COLOR_GD_O_ORANGE = "<font color = \"#D38E43\">";
            GDColor.HTML_COLOR_GD_P_PURPLE = "<font color = \"#A767C6\">";
            GDColor.HTML_COLOR_GD_R_RED = "<font color = \"#FF2E05\">";
            GDColor.HTML_COLOR_GD_S_SILVER = "<font color = \"#787878\">";
            GDColor.HTML_COLOR_GD_T_TEAL = "<font color = \"#00C6A2\">";
            GDColor.HTML_COLOR_GD_W_WHITE = "<font color = \"#9A9A9A\">";
            GDColor.HTML_COLOR_GD_Y_YELLOW = "<font color = \"#B78021\">";
        }
    }

    static {
        GDColor.uiType = UIType.Light;
        COLOR_FG_COMMON_LIGHTUI = Color.BLACK;
        COLOR_FG_MAGICAL_LIGHTUI = new Color(200, 145, 0);
        COLOR_FG_RARE_LIGHTUI = new Color(0, 85, 15);
        COLOR_FG_EPIC_LIGHTUI = new Color(0, 50, 125);
        COLOR_FG_LEGENDARY_LIGHTUI = new Color(68, 0, 125);
        COLOR_FG_COMPONENT_LIGHTUI = new Color(182, 122, 57);
        COLOR_FG_ENCHANTMENT_LIGHTUI = new Color(112, 157, 0);
        COLOR_FG_ARTIFACT_LIGHTUI = new Color(0, 120, 200);
        COLOR_FG_COMMON_DARKUI = Color.WHITE;
        COLOR_FG_MAGICAL_DARKUI = new Color(227, 219, 24);
        COLOR_FG_RARE_DARKUI = new Color(60, 227, 71);
        COLOR_FG_EPIC_DARKUI = new Color(49, 136, 200);
        COLOR_FG_LEGENDARY_DARKUI = new Color(188, 148, 175);
        COLOR_FG_COMPONENT_DARKUI = new Color(219, 148, 69);
        COLOR_FG_ENCHANTMENT_DARKUI = new Color(140, 193, 0);
        COLOR_FG_ARTIFACT_DARKUI = new Color(0, 120, 200);
        COLOR_BG_COMMON_LIGHTUI = Color.WHITE;
        COLOR_BG_MAGICAL_LIGHTUI = new Color(240, 240, 140);
        COLOR_BG_RARE_LIGHTUI = new Color(200, 240, 180);
        COLOR_BG_EPIC_LIGHTUI = new Color(200, 230, 250);
        COLOR_BG_LEGENDARY_LIGHTUI = new Color(230, 200, 250);
        COLOR_BG_COMMON_DARKUI = new Color(16, 16, 16);
        COLOR_BG_MAGICAL_DARKUI = new Color(80, 70, 0);
        COLOR_BG_RARE_DARKUI = new Color(30, 80, 30);
        COLOR_BG_EPIC_DARKUI = new Color(0, 30, 80);
        COLOR_BG_LEGENDARY_DARKUI = new Color(50, 10, 80);
        COLOR_OVERLAY_COMMON = new Color(204, 204, 204);
        COLOR_OVERLAY_MAGICAL = new Color(229, 204, 0);
        COLOR_OVERLAY_RARE = new Color(102, 217, 0);
        COLOR_OVERLAY_EPIC = new Color(76, 115, 217);
        COLOR_OVERLAY_LEGENDARY = new Color(76, 38, 166);
        COLOR_OVERLAY_ARTIFACT = new Color(0, 255, 255);
        COLOR_OVERLAY_COMPONENT = new Color(255, 178, 51);
        COLOR_OVERLAY_ENCHANTMENT = new Color(145, 203, 0);
        COLOR_OVERLAY_QUEST = new Color(204, 51, 229);
        COLOR_OVERLAY_LORE = new Color(194, 176, 196);
        GDColor.COLOR_FG_COMMON = GDColor.COLOR_FG_COMMON_LIGHTUI;
        GDColor.COLOR_FG_MAGICAL = GDColor.COLOR_FG_MAGICAL_LIGHTUI;
        GDColor.COLOR_FG_RARE = GDColor.COLOR_FG_RARE_LIGHTUI;
        GDColor.COLOR_FG_EPIC = GDColor.COLOR_FG_EPIC_LIGHTUI;
        GDColor.COLOR_FG_LEGENDARY = GDColor.COLOR_FG_LEGENDARY_LIGHTUI;
        GDColor.COLOR_FG_COMPONENT = GDColor.COLOR_FG_COMPONENT_LIGHTUI;
        GDColor.COLOR_FG_ENCHANTMENT = GDColor.COLOR_FG_ENCHANTMENT_LIGHTUI;
        GDColor.COLOR_FG_ARTIFACT = GDColor.COLOR_FG_ARTIFACT_LIGHTUI;
        GDColor.COLOR_BG_COMMON = GDColor.COLOR_BG_COMMON_LIGHTUI;
        GDColor.COLOR_BG_MAGICAL = GDColor.COLOR_BG_MAGICAL_LIGHTUI;
        GDColor.COLOR_BG_RARE = GDColor.COLOR_BG_RARE_LIGHTUI;
        GDColor.COLOR_BG_EPIC = GDColor.COLOR_BG_EPIC_LIGHTUI;
        GDColor.COLOR_BG_LEGENDARY = GDColor.COLOR_BG_LEGENDARY_LIGHTUI;
        GDColor.HTML_COLOR_MAGIC = "<font color = \"#B48200\">";
        GDColor.HTML_COLOR_RARE = "<font color = \"#00460A\">";
        GDColor.HTML_COLOR_EPIC = "<font color = \"#002864\">";
        GDColor.HTML_COLOR_LEGENDARY = "<font color = \"#320064\">";
        GDColor.HTML_COLOR_QUEST = "<font color = \"#320064\">";
        GDColor.HTML_COLOR_COMPONENT = "<font color = \"#DA9345\">";
        GDColor.HTML_COLOR_ENCHANTMENT = "<font color = \"#88BE00\">";
        GDColor.HTML_COLOR_SKILL = "<font color = \"#598AE5\">";
        GDColor.HTML_COLOR_ITEM_TYPE = "<font color = \"#C0A560\">";
        GDColor.HTML_COLOR_ITEMSET = "<font color = \"#4D8489\">";
        GDColor.HTML_COLOR_STAT = "<font color = \"#404040\">";
        GDColor.HTML_COLOR_USED_SLOTS = "<font color = \"#000000\">";
        GDColor.HTML_COLOR_CHAR_GD = "<font color = \"#990000\">";
        GDColor.HTML_COLOR_CHAR_AOM = "<font color = \"#008800\">";
        GDColor.HTML_COLOR_CHAR_FG = "<font color = \"#BB4000\">";
        GDColor.HTML_COLOR_GD_A_AQUA = "<font color = \"#60BC9C\">";
        GDColor.HTML_COLOR_GD_B_BLUE = "<font color = \"#3298B5\">";
        GDColor.HTML_COLOR_GD_C_CYAN = "<font color = \"#00C6C6\">";
        GDColor.HTML_COLOR_GD_D_DARKGRAY = "<font color = \"#404040\">";
        GDColor.HTML_COLOR_GD_F_FUSHIA = "<font color = \"#F76782\">";
        GDColor.HTML_COLOR_GD_G_GREEN = "<font color = \"#0DBC47\">";
        GDColor.HTML_COLOR_GD_I_INDIGO = "<font color = \"#5A039A\">";
        GDColor.HTML_COLOR_GD_K_KHAKI = "<font color = \"#A8A163\">";
        GDColor.HTML_COLOR_GD_L_OLIVE = "<font color = \"#7CAD00\">";
        GDColor.HTML_COLOR_GD_M_MAROON = "<font color = \"#800000\">";
        GDColor.HTML_COLOR_GD_O_ORANGE = "<font color = \"#D38E43\">";
        GDColor.HTML_COLOR_GD_P_PURPLE = "<font color = \"#A767C6\">";
        GDColor.HTML_COLOR_GD_R_RED = "<font color = \"#FF2E05\">";
        GDColor.HTML_COLOR_GD_S_SILVER = "<font color = \"#787878\">";
        GDColor.HTML_COLOR_GD_T_TEAL = "<font color = \"#00C6A2\">";
        GDColor.HTML_COLOR_GD_W_WHITE = "<font color = \"#9A9A9A\">";
        GDColor.HTML_COLOR_GD_Y_YELLOW = "<font color = \"#B78021\">";
    }

    public static String replaceTags(final String s) {
        if (GDColor.uiType == UIType.Light) {
            return s;
        }
        String temp = s;
        temp = temp.replaceAll("<font color = \"#60BC9C\">", "<font color = \"#80FFD5\">");
        temp = temp.replaceAll("<font color = \"#3298B5\">", "<font color = \"#39ABCD\">");
        temp = temp.replaceAll("<font color = \"#00C6C6\">", "<font color = \"#00FFFF\">");
        temp = temp.replaceAll("<font color = \"#404040\">", "<font color = \"#1A1A1A\">");
        temp = temp.replaceAll("<font color = \"#F76782\">", "<font color = \"#FF6984\">");
        temp = temp.replaceAll("<font color = \"#0DBC47\">", "<font color = \"#10EB5D\">");
        temp = temp.replaceAll("<font color = \"#5A039A\">", "<font color = \"#5A039A\">");
        temp = temp.replaceAll("<font color = \"#A8A163\">", "<font color = \"#F1E78D\">");
        temp = temp.replaceAll("<font color = \"#7CAD00\">", "<font color = \"#92CC00\">");
        temp = temp.replaceAll("<font color = \"#800000\">", "<font color = \"#800000\">");
        temp = temp.replaceAll("<font color = \"#D38E43\">", "<font color = \"#F3A44D\">");
        temp = temp.replaceAll("<font color = \"#A767C6\">", "<font color = \"#BD9AC7\">");
        temp = temp.replaceAll("<font color = \"#FF2E05\">", "<font color = \"#FF4200\">");
        temp = temp.replaceAll("<font color = \"#787878\">", "<font color = \"#9A9A9A\">");
        temp = temp.replaceAll("<font color = \"#00C6A2\">", "<font color = \"#00FFD2\">");
        temp = temp.replaceAll("<font color = \"#9A9A9A\">", "<font color = \"#FFFFFF\">");
        temp = temp.replaceAll("<font color = \"#B78021\">", "<font color = \"#FFF62C\">");
        if (temp != null) {
            final ByteBuffer buffer = StandardCharsets.UTF_8.encode(temp);
            final String utf8 = temp = StandardCharsets.UTF_8.decode(buffer).toString();
        }
        return temp;
    }

    public enum UIType {
        Dark,
        Light;
    }
}
